using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace CubicFWNet.Data.Models.Mapping
{
    public class TechMaterialMap : EntityTypeConfiguration<TechMaterial>
    {
        public TechMaterialMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.Unit)
                .HasMaxLength(64);

            this.Property(t => t.Memo)
                .HasMaxLength(256);

            // Table & Column Mappings
            this.ToTable("TechMaterial");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.TechId).HasColumnName("TechId");
            this.Property(t => t.MaterialId).HasColumnName("MaterialId");
            this.Property(t => t.Amount).HasColumnName("Amount");
            this.Property(t => t.Unit).HasColumnName("Unit");
            this.Property(t => t.Cost).HasColumnName("Cost");
            this.Property(t => t.Memo).HasColumnName("Memo");
        }
    }
}
